import request from '@/utils/request'

//生成验证码
export function generateVerifyCode(account) {
	return request({
		method: "get",
		url: "openApi/image/getCode/" + account,
		headers: {
			noNeedLogin: true
		}
	});
}

//生成提取码
export function generateExtarCode() {
	return request({
		method: 'get',
		url: 'image/getExtarCode',
		headers: {
			noNeedLogin: true
		}
	})
}

//生成随机码
export function generateUUID() {
	return request({
		method: 'get',
		url: 'image/genUuid',
		headers: {
			noNeedLogin: true
		}
	})
}

//获取附件列表
export function getAttachList(data) {
	return request({
		method: 'post',
		url: 'tbSysAttachment/queryPageList',
		data
	})
}

//附件上传
export function attachUpload(data) {
	return request({
		method: 'post',
		url: 'tbSysAttachment/upload',
		data
	})
}

//附件删除
export function attachDelete(id) {
	return request({
		method: 'post',
		url: 'tbSysAttachment/delete/' + id,
	})
}

//附件删除
export function attachDownload(id) {
	return request({
		method: 'get',
		responseType: 'blob',
		url: 'tbSysAttachment/download/' + id
	})
}

//菜单授权 - 角色
export function roleBatchGrant(data) {
	return request({
		method: 'post',
		url: 'tbSysRoleMenu/addBatch',
		data
	})
}

//登录成功调用
export function loginAddUserInfo() {
	return request({
		method: 'get',
		url: 'tbSysUser/addUserInfo',
	})
}

//根据用户获取资源库类型
export function getLibraryTypeForUser() {
	return request({
		method: 'get',
		url: 'tbNetLibrary/queryListForUser',
	})
}